﻿public static class Utility
{
    
}
public static class Extensions
{
    /// <summary>
    /// 判断是否全部满足
    /// </summary>
    public static bool All(this NeedItemInfo[] arr, bool interact)
    {
        if (arr == null || arr.Length == 0) return true;
        for (var i = 0; i < arr.Length; i++)
        {
            if (!arr[i].Check(interact))
            {
                return false;
            }
        }
        return true;
    }
    /// <summary>
    /// 使用所有物品
    /// </summary>
    public static void Use(this NeedItemInfo[] arr)
    {
        if (arr == null || arr.Length == 0) return;
        for (var i = 0; i < arr.Length; i++)
        {
            InventoryManager.UseItem(arr[i].needItemType);
        }
    }
}